from datetime import datetime

from llmpt.model import GPTTraining


def make_training_name(hyperparams: GPTTraining.Hyperparams | None = None) -> str:
    parts = ["training", datetime.now().strftime("%Y%m%d-%H%M%S-%f")]
    if hyperparams is not None:
        if hyperparams.model.name is not None:
            parts.append(hyperparams.model.name)
        if hyperparams.name is not None:
            parts.append(hyperparams.name)
    return "_".join(parts)
